//
//  messageTableViewCell.m
//  LubanWork
//
//  Created by xiaohao on 2020/1/1.
//  Copyright © 2020 xiaohao. All rights reserved.
//

#import "messageTableViewCell.h"

@implementation messageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style
                    reuseIdentifier:reuseIdentifier]) {
        [self setFrame];
    }
    return self;
}
-(void)setFrame{
    [self addSubview:self.headerImg];
    
    [self addSubview:self.detailLab];
    [self addSubview:self.titLab];
    [self addSubview:self.timeLab];
    [self.headerImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(self).mas_equalTo(kSCRATIO(25));
        make.width.height.mas_offset(kSCRATIO(40));
    }];
    
    [self.detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titLab.mas_bottom).mas_offset(KSCHEIGHT(13.5));
        make.left.mas_equalTo(self.titLab);
    }];
    [self.titLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headerImg.mas_right).mas_offset(kSCRATIO(10));
        make.top.mas_equalTo(self.headerImg.mas_top);
        //        make.right.mas_equalTo(self.detailLab.mas_left).mas_offset(-1);
        make.width.mas_offset(150);
        //        make.height.mas_offset(15);
    }];
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self).mas_offset(-kSCRATIO(24));
        make.bottom.mas_equalTo(self.titLab.mas_bottom);
    }];
    
}
-(UIImageView *)headerImg{
    if (!_headerImg) {
        _headerImg = [[UIImageView alloc] init];
        _headerImg.backgroundColor = [UIColor redColor];
        ViewRadius(_headerImg, kSCRATIO(20));
    }
    return _headerImg;
}
-(UILabel *)titLab{
    if (!_titLab) {
        _titLab = [UILabel CreatLabeltext:@"职位名称职位名称" Font:MarkFont(15) Textcolor:ColorBlack textAlignment:NSTextAlignmentLeft];
    }
    return _titLab;
}
-(UILabel *)detailLab{
    if (!_detailLab) {
        _detailLab = [UILabel CreatLabeltext:@"你好，感谢您报名此职位，请耐心等候企业录取。" Font:kFONT(12) Textcolor:kColorFromRGBHex(0xAAAAAA) textAlignment:NSTextAlignmentLeft];
    }
    return _detailLab;
}

-(UILabel *)timeLab{
    if (!_timeLab) {
        _timeLab = [UILabel CreatLabeltext:@"23:23" Font:kFONT(12) Textcolor:kColorFromRGBHex(0xAAAAAA) textAlignment:NSTextAlignmentLeft];
    }
    return _timeLab;
}
@end
